package co.edu.unal.geditor.view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;

import co.edu.unal.geditor.model.ClosedGraphElement;
import co.edu.unal.geditor.model.EllipseElement;
import co.edu.unal.geditor.model.GraphElement;

public class EllipseGraphView extends ElementView {
	public EllipseGraphView(GraphElement ge) {
		super(ge);

		assert ge instanceof EllipseElement;
	}

	@Override
	public void paint(Graphics g) {
		Point ul = m_owner.getUpLeft();
		Color color = m_owner.getLinesColor();
		Color fillColor = ((ClosedGraphElement)m_owner).getFillColor();
		
		Color tmp=g.getColor();
		g.setColor(fillColor);
		g.fillOval(ul.x, ul.y, m_owner.getBoundBox().getWidth(), m_owner
				.getBoundBox().getHeight());
		g.setColor(color);
		g.drawOval(ul.x, ul.y, m_owner.getBoundBox().getWidth(), m_owner
				.getBoundBox().getHeight());
		g.setColor(tmp);
		super.paint(g);
	}
}
